package com.yonyou.crm.csns.phonebook.rmimpl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.dubbo.config.annotation.Service;
import com.yonyou.crm.csns.phonebook.entity.PersonListVO;
import com.yonyou.crm.csns.phonebook.rmitf.IPhonebookRmService;
import com.yonyou.crm.csns.phonebook.service.OrgBizServiceImpl;
import com.yonyou.crm.csns.phonebook.service.PersonBizServiceImpl;

@Service
public class PhonebookRmServiceImpl implements IPhonebookRmService {
	
	@Autowired
	private OrgBizServiceImpl orgService;
	
	@Autowired
	private PersonBizServiceImpl personService;
	
	public void synPersonData(){
		personService.synPersonData();
	}
	
	@Override
	public List<PersonListVO> getPersonList(Map<String, Object> paraMap) {
		return personService.getPersonList(paraMap);
	}

	@Override
	public Map<String, Object> getOrganization(Long deptId) {
		return orgService.getOrganization(deptId);
	}

	@Override
	public Map<String, Integer> countOneByDeptIds() {
		return orgService.countAllByDeptId();
	}

	@Override
	public List<Map<String, Object>> getDeptWithSub(Long deptId) {
		return orgService.getDeptWithSub(deptId);
	}

	@Override
	public List<Map<String, Object>> getOrgTree() {
		return orgService.getOrgTree();
	}
	
	/*
	 * 通讯录搜索，关键字可以是部门名称或者人员姓名，结果包含部门列表和人员列表
	 */
	@Override
	public Map<String, Object> searchList(String searchKey) {
		return orgService.searchList(searchKey);
	}

}
